﻿using DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BussinessLogic
{
    public class BLUser
    {
        private DAUsers UserRepository = new DAUsers();

        public List<User> GetUsers(int CurrentPage, int CurrentSize, out int TotalPages)
        {
            return UserRepository.GetUsers(CurrentPage, CurrentSize, out TotalPages);
        }

        public bool CreatUser(ref User user)
        {
            return UserRepository.Insert(ref user);
        }

        public bool DeleteUser(int userId)
        {
            return UserRepository.Delete(userId);
        }

        public User GetUser(int userId)
        {
            return UserRepository.GetUser(userId);
        }

        public bool Update(User user)
        {
            return UserRepository.Update(user);
        }

        public bool CheckUser(string username)
        {
            return UserRepository.CheckUsername(username);
        }

        public User GetUser(string username, string password)
        {
            return UserRepository.GetUser(username, password);
        }
    }

}